<?php $this->load->view('header'); ?>
<?php $this->load->view('cuerpo'); ?>

<?php $total = "";
foreach ($detalle as $d){
	$cantidad = $d->cantidad;
	$precio = $d->precio;
	$pc = $precio*$cantidad;
	$total += $pc;
}
?>
<div class="formulario">
	<center><input type="button" onclick="location.href='<?php echo base_url();?>index.php/cotizacion/reporte'" value="Regresar"></center><br/>
	<form>
		<table>
			<tr>
				<td><label>N° de solicitud</label></td>
				<td><input type="text" name="txtNsolicitud" value="<?php echo $id_solicitud;?>" disabled /></td>
			</tr>
			<tr>
				<td><label>Monto Total</label></td>
				<td><input type="text" name="txtMonto" value="<?= $total ?>" disabled /></td>
			</tr>
			<tr>
				<td><label>Fecha Generada</label></td>
				<td><input type="text" name="dFecha" value="<?php echo $fecha_entrega; ?>" disabled/></td>
			</tr>
		</table>
	</form>
</div>
<section id="dt_example">
	<div id="container">
		<table border="1" class="display" id="detalle">
			<thead>
				<tr>
					<th>CASO</th>
					<th>Fecha Generada</th>
					<th>Repuesto</th>
					<th># PARTE</th>					
					<th>O/A</th>
					<th>CANTIDAD</th>
					<th>PRECIO</th>
					<th>P*C</th>
					<th>Monto</th>	
				</tr>
			</thead>
			<tbody>
				<?php
				$n="";
				foreach ($detalle as $d){ 
					$n += 1;
				?>				
				<tr>
					<td><?php echo $n?></td>
					<td><?php echo $d->fecha_entrega ?></td>
					<td><?php echo $d->repuesto ?></td>
					<td><?php echo $d->parte ?></td>
					<td><?php echo $d->tipo ?></td>
					<td><?php echo $d->cantidad ?></td>
					<td><?php echo $d->precio ?></td>
					<td><?php echo $d->total ?></td>
					<td><?php echo $d->total ?></td>			
				</tr>
				 <?php }; ?>
			</tbody>
		</table>
	</div>
</section>
<br>

<?php $this->load->view('footer'); ?>